Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass --isolated to pip #232

Merged
merged 2 commits into from
Sep 6, 2019
Merged

Pass --isolated to pip #232

merged 2 commits into from
Sep 6, 2019

Conversation

keith
Copy link
Member

@keith keith commented Sep 5, 2019

This fixes an issue where if you have bad URLs in your ~/.pip/pip.conf,
pip would pick them up and end up failing bazel. This way we make
pip_import more hermetic and ignore user config.

You can reproduce this issue by adding:

[global]
extra-index-url =
    https://foo.com/bar

To your local ~/.pip/pip.conf, and executing a pip_import rule (it fails faster if your URL returns 500s rather than is just unaccessible)

This fixes an issue where if you have bad URLs in your ~/.pip/pip.conf,
pip would pick them up and end up failing bazel. This way we make
pip_import more hermetic and ignore user config.
@brandjon
Copy link
Member

brandjon commented Sep 6, 2019

Thanks for the change. Will merge shortly.

@brandjon brandjon merged commit 54d1cb3 into bazelbuild:master Sep 6, 2019
@keith
Copy link
Member Author

keith commented Sep 6, 2019 via email

keith added a commit to keith/rules_python that referenced this pull request Dec 8, 2020
This fixes the same issue as
bazelbuild#232 but in another
place.
keith added a commit to keith/rules_python that referenced this pull request Dec 8, 2020
This fixes the same issue as
bazelbuild#232 but in another
place.
thundergolfer pushed a commit that referenced this pull request Jan 5, 2021
This fixes the same issue as
#232 but in another
place.

Co-authored-by: Jonathon Belotti <jonathon@canva.com>
@slsyy
Copy link

slsyy commented Apr 7, 2021

Can we do it configurable/revert? It breaks previous behavior. I use PIP_INDEX_URL environment variable to select PyPI repository. I do not see any other option, because depending on build environment I use a different PIP_INDEX_URL, so I can not embed in a requirements.txt. I would be pleased, if you have some workaround to tackle that situation @brandjon @keith

@keith keith deleted the ks/add-isolated branch April 7, 2021 23:18
@keith
Copy link
Member Author

keith commented Apr 7, 2021

I think it would be fine to configure if the maintainers are ok with another option for that, you can probably workaround this in the meantime by passing --index-url or --extra-index-url through via extra_pip_args, which would also have the benefit of actually being reproducible across multiple folks machines

@slsyy
Copy link

slsyy commented Apr 8, 2021

@keith in my case I also need an user/password pair to use PyPI repo: PIP_INDEX_URL=https://login:pass@repo.url, which need to be unique for each user, and the env variable seems to be the easiest way to generate it by some script

@thundergolfer
Copy link

@slsyy I don't have an immediate solution, but could any of these approaches work for you? bazel-contrib/rules_jvm_external#80 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants